<#include "/top.html">
<div class="layui-layout layui-layout-content">
<#include "/cmsMenu.html">		
<div class="layui-body">
<div class="row">
	<div class="col-lg-12">
		<h1 class="site-h1" style="background-color:#FFFFFF;">
			用户列表<#if commentList??>（${commentList?size}）</#if>
			<span style="float:right;">
				<button class="layui-btn layui-btn-small green" href="/admin/user/add.html" data-toggle="ajax" data-width="750" data-title="创建新文章">
					创建新用户
				</button>
			</span>
		</h1>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12">
				<table class="layui-table" lay-skin="line">
				  <colgroup>
						<col width="20%">
						<col width="15%">
						<col width="25%">
						<col width="15%">
						<col width="10%">
						<col width="15%">
						<col width="1%">
						<col>
				  </colgroup>
				  <thead>
					<tr>
					  <th>标题</th>
					  <th>ip</th>
					  <th>文章ID</th>
					  <th>email</th>
					  <th>内容</th>
					  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
					</tr> 
				  </thead>
				  <tbody>
					<#if commentList?? && commentList.list??>
					<#list commentList.list as user>
					<tr>
					  <td>
							<a href="">
								<i class="layui-icon headimg">&#xe612;</i>
								<div style="margin-left:50px;margin-top:0px;">
									${user.name!''}
								</div>
							</a>
							
					  </td>
					  <td>${user.ip!''}</td>
					  <td>${user.articleId!''}</td>
					  <td>${user.email!''}</td>
					 
					  <td>${user.content!''}</td>
					  <td style="white-space:nowrap;" nowrap="nowrap">
					  		<a href="/cms/comment/edit.html?id=${user.id!''}" data-toggle="ajax" data-width="750" data-title="编辑用户信息">
					  			<i class="layui-icon">&#xe642;</i>
					  			编辑
					  		</a>
					  		
					  		<a href="/cms/comment/delete.html?id=${user.id!''}" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否删除记录？">
					  			<i class="layui-icon" style="color:red;">&#x1006;</i>
					  			删除
					  		</a>
					  		
					  </td>
					</tr>
					</#list>
					</#if>
				  </tbody>
				</table>
			</div> 	   
		</div>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12" id="page" style="text-align:center;"></div>
		</div>
	</div>	
</div>
</div>
</div>

<script>
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  
		  laypage({
				cont: 'page'
				,pages: <#if commentList??>${commentList.pages}<#else>0</#if> //总页数
				,curr:<#if commentList??>${commentList.pageNum}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/cms/comment/index.html?p="+data.curr ;
					}
				}
		   });
		});
</script>